package ar.edu.utn.frgp.controller;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class IndexServlet extends HttpServlet{

	/**
	 * 
	 */
	
	public String message;
	
	private static final long serialVersionUID = 1L;

	public IndexServlet(){
		super();
	}
	
	public void init(){
		message = "Hola que tal?";
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		
		String param1 = request.getParameter("param1");
		String param2 = request.getParameter("param2");
		
		String content = "<h1>Bienvenido Maxi</h1><br/>" + message;
		content = content + "<p>Paramaetro 1: " + param1 + "</p>";
		content = content + "<p>Paramaetro 2: " + param2 + "</p>";
		
		
		out.println("<script type=text/javascript> alert('Paquete reservado con exito.'); </script>");
	
		//out.println(content);
	}
}
